<?php
/**
 * ProductAd
 *
 * PHP version 5
 *
 * @category Class
 * @package  AmazonAdvertisingApi
 * @author   vv_guo
 * @link    https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 */

/**
 * Amazon Ads API for Sponsored Display
 *
 * This API enables programmatic access for campaign creation, management, and reporting for Sponsored Display campaigns. For more information on the functionality, see the [Sponsored Display Support Center](https://advertising.amazon.com/help#GTPPHE6RAWC2C4LZ). For API onboarding information, see the [account setup](https://advertising.amazon.com/API/docs/en-us/guides/onboarding/overview) topic.<br/><br/> > This specification is available for download from the **[Advertising API developer portal](https://d3a0d0y2hgofx6.cloudfront.net/openapi/en-us/sponsored-display/3-0/openapi.yaml).**
 *
 * OpenAPI spec version: 3.0
 * 
 * Generated by:https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api.git
 * AmazonAdvertisingApi Codegen version: 3.0.51
 */
/**
 * NOTE: This class is auto generated by the AmazonAdvertisingApi code generator program.
 *https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 * Do not edit the class manually.
 */

namespace AmazonAdvertisingApi\Model;
use \AmazonAdvertisingApi\ObjectSerializer;

/**
 * ProductAd Class Doc Comment
 *
 * @category Class
 * @package  AmazonAdvertisingApi
 * @author   vv_guo
 * @link    https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 */
class ProductAd extends BaseProductAd 
{
    const DISCRIMINATOR = null;

    /**
      * The original name of the model.
      *
      * @var string
      */
    protected static $AmazonAdvertisingApiModelName = 'ProductAd';

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $AmazonAdvertisingApiTypes = [
        'ad_id' => '\AmazonAdvertisingApi\Model\AdId',
        'ad_group_id' => '\AmazonAdvertisingApi\Model\AdGroupId',
        'campaign_id' => '\AmazonAdvertisingApi\Model\CampaignId',
        'landing_page_url' => '\AmazonAdvertisingApi\Model\LandingPageURL',
        'landing_page_type' => '\AmazonAdvertisingApi\Model\LandingPageType',
        'ad_name' => '\AmazonAdvertisingApi\Model\AdName',
        'asin' => 'string',
        'sku' => 'string'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $AmazonAdvertisingApiFormats = [
        'ad_id' => null,
        'ad_group_id' => null,
        'campaign_id' => null,
        'landing_page_url' => null,
        'landing_page_type' => null,
        'ad_name' => null,
        'asin' => null,
        'sku' => null
    ];

    /**
     * Array of property to type mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function AmazonAdvertisingApiTypes()
    {
        return self::$AmazonAdvertisingApiTypes + parent::AmazonAdvertisingApiTypes();
    }

    /**
     * Array of property to format mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function AmazonAdvertisingApiFormats()
    {
        return self::$AmazonAdvertisingApiFormats + parent::AmazonAdvertisingApiFormats();
    }

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'ad_id' => 'adId',
        'ad_group_id' => 'adGroupId',
        'campaign_id' => 'campaignId',
        'landing_page_url' => 'landingPageURL',
        'landing_page_type' => 'landingPageType',
        'ad_name' => 'adName',
        'asin' => 'asin',
        'sku' => 'sku'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'ad_id' => 'setAdId',
        'ad_group_id' => 'setAdGroupId',
        'campaign_id' => 'setCampaignId',
        'landing_page_url' => 'setLandingPageUrl',
        'landing_page_type' => 'setLandingPageType',
        'ad_name' => 'setAdName',
        'asin' => 'setAsin',
        'sku' => 'setSku'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'ad_id' => 'getAdId',
        'ad_group_id' => 'getAdGroupId',
        'campaign_id' => 'getCampaignId',
        'landing_page_url' => 'getLandingPageUrl',
        'landing_page_type' => 'getLandingPageType',
        'ad_name' => 'getAdName',
        'asin' => 'getAsin',
        'sku' => 'getSku'
    ];

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @return array
     */
    public static function attributeMap()
    {
        return parent::attributeMap() + self::$attributeMap;
    }

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @return array
     */
    public static function setters()
    {
        return parent::setters() + self::$setters;
    }

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @return array
     */
    public static function getters()
    {
        return parent::getters() + self::$getters;
    }

    /**
     * The original name of the model.
     *
     * @return string
     */
    public function getModelName()
    {
        return self::$AmazonAdvertisingApiModelName;
    }




    /**
     * Constructor
     *
     * @param mixed[] $data Associated array of property values
     *                      initializing the model
     */
    public function __construct(array $data = null)
    {
        parent::__construct($data);

        $this->container['ad_id'] = isset($data['ad_id']) ? $data['ad_id'] : null;
        $this->container['ad_group_id'] = isset($data['ad_group_id']) ? $data['ad_group_id'] : null;
        $this->container['campaign_id'] = isset($data['campaign_id']) ? $data['campaign_id'] : null;
        $this->container['landing_page_url'] = isset($data['landing_page_url']) ? $data['landing_page_url'] : null;
        $this->container['landing_page_type'] = isset($data['landing_page_type']) ? $data['landing_page_type'] : null;
        $this->container['ad_name'] = isset($data['ad_name']) ? $data['ad_name'] : null;
        $this->container['asin'] = isset($data['asin']) ? $data['asin'] : null;
        $this->container['sku'] = isset($data['sku']) ? $data['sku'] : null;
    }

    /**
     * Show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     */
    public function listInvalidProperties()
    {
        $invalidProperties = parent::listInvalidProperties();

        return $invalidProperties;
    }

    /**
     * Validate all the properties in the model
     * return true if all passed
     *
     * @return bool True if all properties are valid
     */
    public function valid()
    {
        return count($this->listInvalidProperties()) === 0;
    }


    /**
     * Gets ad_id
     *
     * @return \AmazonAdvertisingApi\Model\AdId
     */
    public function getAdId()
    {
        return $this->container['ad_id'];
    }

    /**
     * Sets ad_id
     *
     * @param \AmazonAdvertisingApi\Model\AdId $ad_id ad_id
     *
     * @return $this
     */
    public function setAdId($ad_id)
    {
        $this->container['ad_id'] = $ad_id;

        return $this;
    }

    /**
     * Gets ad_group_id
     *
     * @return \AmazonAdvertisingApi\Model\AdGroupId
     */
    public function getAdGroupId()
    {
        return $this->container['ad_group_id'];
    }

    /**
     * Sets ad_group_id
     *
     * @param \AmazonAdvertisingApi\Model\AdGroupId $ad_group_id ad_group_id
     *
     * @return $this
     */
    public function setAdGroupId($ad_group_id)
    {
        $this->container['ad_group_id'] = $ad_group_id;

        return $this;
    }

    /**
     * Gets campaign_id
     *
     * @return \AmazonAdvertisingApi\Model\CampaignId
     */
    public function getCampaignId()
    {
        return $this->container['campaign_id'];
    }

    /**
     * Sets campaign_id
     *
     * @param \AmazonAdvertisingApi\Model\CampaignId $campaign_id campaign_id
     *
     * @return $this
     */
    public function setCampaignId($campaign_id)
    {
        $this->container['campaign_id'] = $campaign_id;

        return $this;
    }

    /**
     * Gets landing_page_url
     *
     * @return \AmazonAdvertisingApi\Model\LandingPageURL
     */
    public function getLandingPageUrl()
    {
        return $this->container['landing_page_url'];
    }

    /**
     * Sets landing_page_url
     *
     * @param \AmazonAdvertisingApi\Model\LandingPageURL $landing_page_url landing_page_url
     *
     * @return $this
     */
    public function setLandingPageUrl($landing_page_url)
    {
        $this->container['landing_page_url'] = $landing_page_url;

        return $this;
    }

    /**
     * Gets landing_page_type
     *
     * @return \AmazonAdvertisingApi\Model\LandingPageType
     */
    public function getLandingPageType()
    {
        return $this->container['landing_page_type'];
    }

    /**
     * Sets landing_page_type
     *
     * @param \AmazonAdvertisingApi\Model\LandingPageType $landing_page_type landing_page_type
     *
     * @return $this
     */
    public function setLandingPageType($landing_page_type)
    {
        $this->container['landing_page_type'] = $landing_page_type;

        return $this;
    }

    /**
     * Gets ad_name
     *
     * @return \AmazonAdvertisingApi\Model\AdName
     */
    public function getAdName()
    {
        return $this->container['ad_name'];
    }

    /**
     * Sets ad_name
     *
     * @param \AmazonAdvertisingApi\Model\AdName $ad_name ad_name
     *
     * @return $this
     */
    public function setAdName($ad_name)
    {
        $this->container['ad_name'] = $ad_name;

        return $this;
    }

    /**
     * Gets asin
     *
     * @return string
     */
    public function getAsin()
    {
        return $this->container['asin'];
    }

    /**
     * Sets asin
     *
     * @param string $asin The Amazon ASIN of the product advertised by the product ad.
     *
     * @return $this
     */
    public function setAsin($asin)
    {
        $this->container['asin'] = $asin;

        return $this;
    }

    /**
     * Gets sku
     *
     * @return string
     */
    public function getSku()
    {
        return $this->container['sku'];
    }

    /**
     * Sets sku
     *
     * @param string $sku The Amazon SKU of the product advertised by the product ad.
     *
     * @return $this
     */
    public function setSku($sku)
    {
        $this->container['sku'] = $sku;

        return $this;
    }
    /**
     * Returns true if offset exists. False otherwise.
     *
     * @param integer $offset Offset
     *
     * @return boolean
     */
    #[\ReturnTypeWillChange]
    public function offsetExists($offset)
    {
        return isset($this->container[$offset]);
    }

    /**
     * Gets offset.
     *
     * @param integer $offset Offset
     *
     * @return mixed
     */
    #[\ReturnTypeWillChange]
    public function offsetGet($offset)
    {
        return isset($this->container[$offset]) ? $this->container[$offset] : null;
    }

    /**
     * Sets value based on offset.
     *
     * @param integer $offset Offset
     * @param mixed   $value  Value to be set
     *
     * @return void
     */
    #[\ReturnTypeWillChange]
    public function offsetSet($offset, $value)
    {
        if (is_null($offset)) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

    /**
     * Unsets offset.
     *
     * @param integer $offset Offset
     *
     * @return void
     */
    #[\ReturnTypeWillChange]
    public function offsetUnset($offset)
    {
        unset($this->container[$offset]);
    }

    /**
     * Gets the string presentation of the object
     *
     * @return string
     */
    public function __toString()
    {
        if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
            return json_encode(
                ObjectSerializer::sanitizeForSerialization($this),
                JSON_PRETTY_PRINT
            );
        }

        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
    }
}
